﻿using System;
using System.Data.Common;

namespace Ooaavee.Data.Queries
{
    /// <summary>
    /// Provides data for the <see cref="QueryContext.QueryError"/> event.
    /// </summary>
    public sealed class QueryErrorEventArgs : EventArgs
    {
        private readonly DbException _exception;

        internal QueryErrorEventArgs(DbException exception)
        {
            _exception = exception;
        }

        /// <summary>
        /// The exception thrown by the data source.
        /// </summary>
        public DbException Exception { get { return _exception; } }
    }
}
